package com.sourcestream.whileaway;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Layout;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.util.Calendar;
import java.util.Date;

public class MainActivity extends Activity
{
    private AlertDialog dialog;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        View view = getLayoutInflater().inflate(R.layout.main, null);

        TextView missedCalls = (TextView)view.findViewById(R.id.missedCalls);
        missedCalls.setText(getString(R.string.missedCalls) + ": " + getIntent().getExtras().get("MissedCalls"));

        TextView missedTexts = (TextView)view.findViewById(R.id.missedTexts);
        missedTexts.setText(getString(R.string.missedTexts) + ": " + getIntent().getExtras().get("MissedTexts"));

        AlertDialog.Builder builder =  new AlertDialog.Builder(this);
        builder.setView(view);
        dialog = builder.create();
        dialog.setCanceledOnTouchOutside(true);
        dialog.setOnDismissListener(new DialogInterface.OnDismissListener()
        {
            public void onDismiss(DialogInterface dialogInterface)
            {
                MainActivity.this.finish();
            }
        });

        dialog.show();
    }

    public void doClick(View view)
    {
        dialog.dismiss();
    }
}